package com.zhangtai.modules.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhangtai.modules.entity.employee.PromotionEntity;
import com.zhangtai.modules.entity.promotion.PromotionBatchGroupEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-10-12 10:40:19
 */
@Mapper
public interface PromotionBatchGroupDao extends BaseMapper<PromotionBatchGroupEntity> {

    @Select("select t3.* from tb_promotion_batch t1 left join tb_promotion_batch_group t2 on t1.id = t2.batch_id " +
            "left join tb_promotion t3 on t3.promotion_id = t2.promotion_id " +
            "where t1.id = #{id}")
     List<PromotionEntity> getPromtionBtachList(@Param("id") String id);
}
